home *** CD-ROM | disk | FTP | other *** search
/ Practical Web Pages 2004 September / PracticalWebPages-WPG13-09-2004-Coverdisc.iso / pc / Software / Toolkit / Sothink SWF Quicker 1.5 / data1.cab / Public_Files / Effects / ActionScript / Scale / Disappear.sqe < prev    next >
Encoding:
Text File  |  2004-06-14  |  3.6 KB  |  148 lines

  1. ========== Description Part Begin ==========
  2. name = "Disappear";
  3. description = "The characters become smaller and smaller, disappear in the distance for a while, but reappear in the end.";
  4. version = "1.00";
  5. bin = "Disappear.bin";
  6. ========== Description Part End ==========
  7.  
  8. ========== Parameter Part Begin ==========
  9. $nCharacterCount(EDIT,INT,1,1 10000,"Total Characters ","The total characters using the special effect. The value is defined by the selected characters in the movie, but can not be changed in the property box.");
  10. $nFrameCount(EDIT,INT,3,3 3,"Total Frames","It indicates the total frames of actions. The total frames of the effect is probably more than it.");
  11. $nScaleSpeed(EDIT,INT,10,1 100,"Scaling Speed","To control the speed of character scaling.");
  12. $nAlphaSpeed(EDIT,INT,3,1 100,"Fading Speed","To control the speed of character fading.");
  13. $bDirection(LIST,INT,0,"Left":1 "Right":0,"Direction","To control the change of character to start from the left side or from the right one");
  14. $nInterval(EDIT,INT,5,1 10000,"Interval"," The time difference between the former character and the latter one beginning to change.");
  15.  
  16. $nMaxScale(EDIT,INT,200,100 10000,"Maxi Scaling","The maximun value of character scaling.");
  17. $nMinScale(EDIT,INT,0,0 10000,"Mini Scaling","The minimum value of character scaling.");
  18. ========== Parameter Part End ==========
  19.  
  20. ========== Function Part Begin ==========
  21. nCharacterCount = 8;
  22. nFrameCount = 3;
  23. nAlphaSpeed = 3;
  24.  
  25.  
  26. nScaleSpeed = 10;
  27. nInterval = 5;
  28. bDirection = 0;
  29. nMaxScale = 200;
  30. nMinScale = 0;
  31.  
  32.  
  33.  
  34.  
  35. nCharacter_x = new Array(nCharacterCount);
  36. nCharacter_y = new Array(nCharacterCount);
  37. nIsRun = new Array(nCharacterCount);
  38. nMode = new Array(nCharacterCount);
  39. nWhoRun = 1;
  40.  
  41. for (i = 1; i <= nCharacterCount; i++)
  42. {
  43.     this["c" + i]._alpha = 0;
  44.  
  45.     this["c" + i]._xscale = 200;
  46.     this["c" + i]._yscale = 200;
  47.     nCharacter_x[i - 1] = this["c" + i]._x;
  48.     nCharacter_y[i - 1] = this["c" + i]._y;
  49.     
  50.     nMode[i -1] = true;
  51.     
  52.     if(bDirection)
  53.     {
  54.         if(i == 1)
  55.             nIsRun[0] = 0;
  56.         else
  57.         {
  58.             nIsRun[i - 1] = nIsRun[i - 2];
  59.             nIsRun[i - 1] += nInterval ;
  60.         }
  61.     }
  62.     else
  63.     {
  64.         if(i == 1)
  65.             nIsRun[nCharacterCount -1] = 0;
  66.         else
  67.         {
  68.             nIsRun[nCharacterCount - i] = nIsRun[nCharacterCount - (i  - 1) ];
  69.             nIsRun[nCharacterCount - i] += nInterval ;
  70.         }
  71.         
  72.     }
  73.  
  74.  
  75.     
  76. }
  77.  
  78.  
  79.  
  80.  
  81. function fun()
  82. {
  83.     for (i = 1; i <= nCharacterCount; i++)
  84.     {
  85.         if (nIsRun[i - 1] <= 0)
  86.         {
  87.             if(nMode[i -1])
  88.             {                
  89.                 this["c" + i]._xscale = this["c" + i]._xscale - nScaleSpeed;
  90.                 this["c" + i]._yscale = this["c" + i]._yscale - nScaleSpeed;
  91.                 this["c" + i]._alpha = this["c" + i]._alpha + nAlphaSpeed;
  92.                 
  93.                 if(this["c" + i]._xscale < nMinScale)
  94.                 {
  95.                     this["c" + i]._xscale = 0;
  96.                     this["c" + i]._yscale = 0;
  97.                 }
  98.                 if(this["c" + i]._alpha > 100)
  99.                     nMode[i -1] = false;
  100.     
  101.             }
  102.             else
  103.             {
  104.                 this["c" + i]._xscale = this["c" + i]._xscale + nScaleSpeed;
  105.                 this["c" + i]._yscale = this["c" + i]._yscale + nScaleSpeed;
  106.                 this["c" + i]._alpha = this["c" + i]._alpha - nAlphaSpeed;
  107.                 
  108.                 
  109.                 if(this["c" + i]._xscale > nMaxScale)
  110.                 {
  111.                     this["c" + i]._xscale = nMaxScale;
  112.                     this["c" + i]._yscale = nMaxScale;
  113.                 }
  114.                 if(this["c" + i]._alpha < 0)
  115.                     nMode[i -1] = true;
  116.  
  117.             }
  118.  
  119.             
  120.  
  121.            
  122.         } 
  123.         else
  124.             nIsRun[i -1]--;
  125.     } 
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132. function again()
  133. {
  134.     gotoAndPlay(2);
  135. }
  136.  
  137. ========== Function Part End ==========
  138.  
  139. ========== Frame Part Begin ==========
  140. $frame(fun,1,-1,"fun");
  141. $frame(fun,2,-1,"fun");
  142. $frame(again,3,-1,"again");
  143. ========== Frame Part End ==========
  144.  
  145.  
  146.